<?php
namespace Home\Controller;
use Common\Controller\MyInitController;
class TestController extends MyInitController {
   public function index(){
        
    	$this->display();
    }
    public function check(){
    	$id=I('post.id');
    	$password=I('post.password');
    	$form=M('login');
   		$dataid=$form->where("id='$id'")->find();
    	if($dataid[password]==$password&&$password!=NULL){
    		$this->success('登录成功',U('Index/mainview'));
    	}else{
    		$this->error('账户或密码错误');            
    	}
    }
    public function edit(){
        //layout(false);
        $Edit=M('cplatv2_gt_questionbank',null);
        $Edit->create();
        $Edit->save();
        $this->display();
    }
    public function chuli(){
        $id=I('post.id');
        $Edit=M('cplatv2_gt_questionbank');
        $data=$Edit->where("id='$id'")->find();
        $this->assign('data',$data);
        $this->display();
    }
}
